package com.wyl.auth.controller;

import com.wyl.auth.req.UserOperationLogReq;
import com.wyl.auth.service.UserOperationLogService;
import com.wyl.auth.vo.UserOperationLogVo;
import com.wyl.common.CommonPage;
import com.wyl.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @Description 用户操作日志
* @Author WuYiLong
* @Date 2025-04-16
*/
@Api(tags = "用户操作日志api")
@RestController
@RequestMapping("userOperationLog")
public class UserOperationLogController {

    @Autowired
    private UserOperationLogService userOperationLogService;

    @ApiOperation(value = "分页")
    @PostMapping(value = "page")
    public ResponseData<CommonPage<UserOperationLogVo>> page(@RequestBody UserOperationLogReq req) {
        return ResponseData.getSuccessInstance(userOperationLogService.page(req));
    }

    @ApiOperation(value = "删除")
    @PostMapping(value = "deleteByIds")
    public ResponseData deleteByIds(@RequestBody List<Long> ids) {
        userOperationLogService.deleteByIds(ids);
        return ResponseData.getSuccess();
    }
}
